/*
*使用fill_n编写程序，将一个int型序列的值设为0
*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;

int main()
{
	vector<int> ivec;
	ivec.push_back(2);
	ivec.push_back(5);
	ivec.push_back(4);
	ivec.push_back(1);
	ivec.push_back(8);

	fill_n(ivec.begin(),ivec.size(),0);

	vector<int>::iterator iter = ivec.begin();
	while(iter != ivec.end())
	{
		cout << *iter << "  ";
		++iter;
	}
	cout << endl;
	system("pause");
    return 0;
}